<HTML><HEAD> <!-- -------------- Hello World #1 -------------- --> <SCRIPT LANGUAGE="JavaScript"><!-- hide from old browsers /* THE JAVASCRIPT COOKBOOK by Erica Sadun, webrx@mindspring.com Copyright (c)1998 by Charles River Media. All Rights Reserved. This applet can only be re-used or modifed by license holders of the JavaScript Cookbook CD-ROM. Credit must be given in the source code and this copyright notice must be maintained. If you do not hold a license to the JavaScript Cookbook, you may NOT duplicate or modify this code for your own use. Use at your own risk. No warranty is given or implied of the suitability of this applet for any specific application. Neither Erica Sadun nor Charles River Media will be held responsible for any unwanted effects due to the use of this applet or any derivative. */ <!-- done hiding --></SCRIPT></HEAD> <BODY bgcolor="ffffff" link="0000ff" vlink="770077"> <FONT COLOR="007777"><H1><IMG SRC="../GRAFX/UTENS.JPG" WIDTH=80 HEIGHT=50 ALIGN = LEFT>Communications 101</H1></FONT> <BLOCKQUOTE> <FONT COLOR="770000"> I will say "Hello World" in bold print just below this line by means of a JavaScript program. </FONT></BLOCKQUOTE> <SCRIPT LANGUAGE="JavaScript"> document.write("<b>Hello World!</b><p>") </SCRIPT> <FONT COLOR="007777"><H2>Discussion</H2></FONT> <FONT SIZE=4> In this first program, you see how to include JavaScript directives in your HTML. This three-line script writes a bold "Hello World" followed by a paragraph break. Notice that JavaScript talks in HTML to your browser. Your <FONT COLOR="770000">write</FONT> statements create HTML code which your browser must interpret. <font color="770000" size=3><pre><null ><SCRIPT LANGUAGE="JavaScript"><br><null > document.write("<b>Hello World!</b><p>")<br><null ></SCRIPT> </pre></font> In this example as with all the scripts included on the <b>JavaScript CD Cookbook</b>, make sure to look at the source code that produced this page. Look for the <FONT COLOR="007777"><b>aqua</b></FONT> sections of the source code -- these are the ingredients that make these examples work. The sources will give you lots of ideas and templates to modify for your needs. </FONT> <h5>Copyright ©1996 by Charles River Media, All Rights Reserved</h5> </BODY> </HTML>